Iteration over SetsΒΆ
for n in S
Iteration over Sets.
# Create a set
S = set([0, 1, 2, 3, 4, 5])
for n in S:
print(n, end=", ") # 0, 1, 2, 3, 4, 5
for n in S
# Create a set
S = set([0, 1, 2, 3, 4, 5])
for n in S:
print(n, end=", ") # 0, 1, 2, 3, 4, 5